USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0004_DROP_TABLES]    Script Date: 11/25/2011 11:55:34 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WASP_M0004_DROP_TABLES]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[WASP_M0004_DROP_TABLES]
GO

USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0004_DROP_TABLES]    Script Date: 11/25/2011 11:55:34 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[WASP_M0004_DROP_TABLES]

AS
BEGIN
	if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[as_creditos_vigentes_temp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
	begin
		drop table [dbo].[as_creditos_vigentes_temp]
	end 

	if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CUOTAS_AUX2]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
	begin	
		drop table [dbo].[CUOTAS_AUX2]
	end

	if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CUOTAS_AUX]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
	begin	
		drop table [dbo].[CUOTAS_AUX]
	end

	if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[as_credi_vigente_temp]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
	begin	
		drop table [dbo].[as_credi_vigente_temp]
	end

	if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ult_pago_cr]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
	begin	
		drop table [dbo].[ult_pago_cr]
	end

	if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[AS_CREDI_VIGENTE_SINTASA]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
	begin
		drop table [dbo].[AS_CREDI_VIGENTE_SINTASA]
	end
	
	if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ERROR_CUOTAS]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
	begin	
		drop table [dbo].[ERROR_CUOTAS]
	end
END

GO


